const fs = require('fs');
function timeout(fileName) {
  return new Promise((resolve, reject) => {
    fs.readFile(fileName, 'utf-8', (err, data) => {
      if (err) reject(err);
      else resolve(data);
    })
  })
}

timeout('./name').then((data) => {
  console.log(data);
})